#include <iostream>
#include <vector>
#include "lib/binary_tree.h"
using namespace std;

void mirror(BinaryTreeNode* root) {
  if (!root)
    return;

  if (root->left || root->right) {
    auto tmp = root->left;
    root->left = root->right;
    root->right = tmp;
  }
  mirror(root->left);
  mirror(root->right);
}

int main() {
  vector<int> vec = {8, 6, 10, 5, 7, 9, 11};
  BinaryTreeNode* root = CreateBinaryTree(vec);
  cout << "Origin binary tree: " << endl;
  PrintBinaryTree(root);
  mirror(root);
  cout << "Mirror binary tree: " << endl;
  PrintBinaryTree(root);
  return 0;
}
